﻿CREATE FUNCTION GetDescriptionFromProductVersion 
(
	-- Add the parameters for the function here
	@ProductVersion varchar(12)
)
RETURNS varchar(100)
AS
BEGIN
	-- Return the result of the function
	RETURN 
	(

		SELECT TOP 1 V.Description 
		FROM SQLServerVersions V 
		WHERE 
			REPLACE( V.Version, '.00.','.0.') = 
			dbo.udf_ItemExtract(1,@ProductVersion,'.') + '.' + 
			dbo.udf_ItemExtract(2,@ProductVersion,'.') + '.' + 
			dbo.udf_ItemExtract(3,@ProductVersion,'.')
	)

END
